<template>
  <div class="app-container">
    <div style="display: flex;flex-flow: row nowrap;margin-bottom: 20px;margin-left: 100px">
      <div style="border:1px;background-color: #4e8dff; width: 6px;height: 20px"></div>
      <span style="margin-left: 10px">审核记录</span>
    </div>
    <el-table :data="tableData" style="width: 85%;margin-left: 100px">
      <el-table-column label="提交人" align="center" prop="userName"></el-table-column>
      <el-table-column label="处理人" align="center" prop="apprUserName"></el-table-column>
      <el-table-column label="处理意见" align="center" prop="apprOppinion" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column label="处理状态" align="center" prop="apprResult">
        <template slot-scope="scope">
          {{ getResultType(scope.row.apprResult) }}
        </template>
      </el-table-column>
      <el-table-column label="处理时间" align="center" prop="createTime"></el-table-column>
    </el-table>
  </div>
</template>

<script>
import {getApprList} from "@/api/system/userAppr";

export default {
  name: 'ApprRecords',
  props: {
    userId: String
  },
  dicts: ['appr_opreation_type'],
  data() {
    return {
      tableData: []
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      getApprList(this.userId).then(resp => {
        this.tableData = resp.data
      })
    },
    getResultType(data) {
      if (data !== null) {
        return this.dict.type.appr_opreation_type.find(d => d.value == data).label
      } else {
        return ''
      }
    }
  }
}
</script>
